#include <Arduino.h>
#include <stdint.h>
#include "xtea.h"

void encrypt(uint32_t v[2], const uint32_t key[4]) {
    uint16_t i;
    uint32_t sum=0, delta=0x9E3779B9;

    for (i=0; i < NUM_ROUNDS; i++) {
        v[0] += (((v[1] << 4) ^ (v[1] >> 5)) + v[1]) ^ (sum + key[sum & 3]);
        sum += delta;
        v[1] += (((v[0] << 4) ^ (v[0] >> 5)) + v[0]) ^ (sum + key[(sum>>11) & 3]);
    }
    
}

